package com.njlime.member.service.app;

import com.njlime.core.helper.PageBean;
import com.njlime.member.entiies.MemberNotice;
import com.njlime.member.repository.app.AppMemberNoticeDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

/**
 * Created by Dean on 2017/10/9.
 */
@Service
public class AppMemberNoticeService {
    @Resource
    private AppMemberNoticeDao appMemberNoticeDao;

    /**
     * 获取通知列表
     */
    public PageBean list(PageBean pageBean, MemberNotice memberNotice){
        return appMemberNoticeDao.list(pageBean,memberNotice);
    }

    /**
     * 阅读状态修改
     */
    public Integer readUpdate(Integer id, Integer uid){
        return appMemberNoticeDao.readUpdate(id, uid);
    }

    /**
     * 通知详情
     */
    public Map<String,Object> get(Integer id){
        return appMemberNoticeDao.get(id);
    }

    public Integer save(MemberNotice memberNotice){
        appMemberNoticeDao.save(memberNotice);
        return memberNotice.getId();
    }

}
